//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <ddkit.h>
#include <xllp_gpio.h>
#include <bulverde.h>

#define GPIORegVirtualBase  0x80E00000

//config GPIO port
void GpioSetup()
{
    static const XLLP_UINT32_T inpins[]  = { 11, 81, 55, 51, 50, 83, 48, 17, 12, 54,85,84};
    static const XLLP_UINT32_T outpins[] = {4, 53, 57, 56, 120};
    static const XLLP_UINT32_T altpins[] = {12, 81, 55, 51, 50, 83, 48, 17, 12, 53, 54, 85, 84};
    static const XLLP_UINT32_T altfunc[] = {12, 2,  1,  1,  1,  3,  1,  2,  2,  2,  3,  3,  3};
    P_XLLP_GPIO_T pGPIO = (P_XLLP_GPIO_T)GPIORegVirtualBase;
    XllpGpioSetDirectionOut(pGPIO, (XLLP_UINT32_T*)outpins);
    XllpGpioSetDirectionIn (pGPIO, (XLLP_UINT32_T*)inpins);
    XllpGpioSetAlternateFn (pGPIO, (XLLP_UINT32_T*)altpins, (XLLP_UINT32_T*)altfunc);
}

void GpioCloseCamera()
{
    // Need to do more ...
}
